package com.ruoyi.project.WebMoudle.streamTerrace.service.impl;

import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.WebMoudle.streamTerrace.mapper.StreamTerraceMapper;
import com.ruoyi.project.WebMoudle.streamTerrace.domain.StreamTerrace;
import com.ruoyi.project.WebMoudle.streamTerrace.service.IStreamTerraceService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 平台收入Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-08-15
 */
@Service
public class StreamTerraceServiceImpl implements IStreamTerraceService 
{
    @Autowired
    private StreamTerraceMapper streamTerraceMapper;

    /**
     * 查询平台收入
     * 
     * @param id 平台收入ID
     * @return 平台收入
     */
    @Override
    public StreamTerrace selectStreamTerraceById(Long id)
    {
        return streamTerraceMapper.selectStreamTerraceById(id);
    }

    /**
     * 查询平台收入列表
     * 
     * @param streamTerrace 平台收入
     * @return 平台收入
     */
    @Override
    public List<StreamTerrace> selectStreamTerraceList(StreamTerrace streamTerrace)
    {
        return streamTerraceMapper.selectStreamTerraceList(streamTerrace);
    }

    /**
     * 新增平台收入
     * 
     * @param streamTerrace 平台收入
     * @return 结果
     */
    @Override
    public int insertStreamTerrace(StreamTerrace streamTerrace)
    {
        streamTerrace.setCreateTime(DateUtils.getNowDate());
        return streamTerraceMapper.insertStreamTerrace(streamTerrace);
    }

    /**
     * 修改平台收入
     * 
     * @param streamTerrace 平台收入
     * @return 结果
     */
    @Override
    public int updateStreamTerrace(StreamTerrace streamTerrace)
    {
        return streamTerraceMapper.updateStreamTerrace(streamTerrace);
    }

    /**
     * 删除平台收入对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteStreamTerraceByIds(String ids)
    {
        return streamTerraceMapper.deleteStreamTerraceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除平台收入信息
     * 
     * @param id 平台收入ID
     * @return 结果
     */
    @Override
    public int deleteStreamTerraceById(Long id)
    {
        return streamTerraceMapper.deleteStreamTerraceById(id);
    }

    @Override
    public String querySum() {
        return streamTerraceMapper.querySum();
    }
}
